home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
incl
/
LEDA.020+881
/
subdivision.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
2KB
|
73 lines
/*******************************************************************************
+
+ LEDA 3.1c
+
+
+ subdivision.h
+
+
+ Copyright (c) 1994 by Max-Planck-Institut fuer Informatik
+ Im Stadtwald, 6600 Saarbruecken, FRG
+ All rights reserved.
+
*******************************************************************************/
#ifndef LEDA_SUBDIVISION_H
#define LEDA_SUBDIVISION_H
#include <LEDA/point.h>
#include <LEDA/planar_map.h>
class SubDivision : public planar_map
{
face outer_face;
void* strip_ptr; //pointer to strip_list
public:
SubDivision(const graph&);
~SubDivision();
point position(node v) const { return ACCESS(point,inf(v)); }
face locate_point(point) const;
void print_stripes() const;
};
//------------------------------------------------------------------------------
//
// subdivision: generic subdivisions with face entries of type "ftype"
//
//------------------------------------------------------------------------------
template <class ftype>
class _CLASSTYPE subdivision : public SubDivision {
void copy_face_entry(GenPtr& x) const { x=Copy(ACCESS(ftype,x)); }
void clear_face_entry(GenPtr& x) const { Clear(ACCESS(ftype,x)); }
public:
ftype inf(face f) const {return ACCESS(ftype,SubDivision::inf(f));}
point operator[](node v) const {return ACCESS(point,SubDivision::inf(v));}
ftype operator[](face f) const {return ACCESS(ftype,SubDivision::inf(f));}
void print_node(node v) const { cout << "[" << index(v) <<"] (";
Print(position(v));
cout << ") ";}
subdivision(GRAPH<point,ftype>& G) : SubDivision(G) {}
~subdivision() { clear(); }
};
#endif